import { Component, OnInit, ViewEncapsulation, ViewChild } from '@angular/core';
import { Router } from '@angular/router';
import { TimeService } from '../../service/timeservice/time.service';
import { PopupComponent, SkinType } from 'ngx-weui';
import { Observable, Subscriber } from 'rxjs/Rx';

@Component({
  selector: 'app-outpatientpayrecord',
  templateUrl: './outpatientpayrecord.component.html',
  styleUrls: ['./outpatientpayrecord.component.css'],
  encapsulation: ViewEncapsulation.None
})
export class OutpatientpayrecordComponent implements OnInit {

  @ViewChild('simple') simplePopup: PopupComponent;

  patientname: string="所有就诊人"

  shown = false;
  radio: any;
  res: any = {
    cho2: true,
    agree: true
  };

  constructor( private service: TimeService, private router: Router ) {
    this.radio = this.service.person; // 就诊人列表
    this.res.radio = this.radio[0]; // 默认选中第一个
  }
  goInfo() {
    this.router.navigate(['/outpatientpayrecord/outpatientpayrecordinfo']);
  }
  check(index) {
    console.log(index)
    this.patientname = this.service.person[index].name;
    this.simplePopup.hide();
  }

  ngOnInit() {
  }

}
